//
//  GoOutInfoModel.m
//  MobileOffice
//
//  Created by jjkj on 16/11/24.
//  Copyright © 2016年 liaoningjujin. All rights reserved.
//

#import "GoOutInfoModel.h"

@implementation GoOutInfoModel
- (instancetype)initWithResponse:(id)responseObject{
    if (self=[super init]) {
        if ([responseObject[@"code"] isKindOfClass:[NSNumber class]]) {
            NSNumber *num =responseObject[@"code"] ;
            NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
            
            NSString* str = [numberFormatter stringFromNumber:num];
            
            self.code=str?str:@"";
        }else{
            self.code=responseObject[@"code"]?responseObject[@"code"]:@"";
        }
        
        self.msg=responseObject[@"msg"]?responseObject[@"msg"]:@"";
        
        NSDictionary *dataDict=responseObject[@"retContent"];
        [self setValuesForKeysWithDictionary:dataDict];
        NSArray *list=dataDict[@"trafficList"];
        _trafficList=[NSMutableArray new];
        for (NSDictionary *dict in list) {
            GoOutInfoModel *model=[GoOutInfoModel new];
            [model setValuesForKeysWithDictionary:dict];
            [_trafficList addObject:model];
        }
    }
    
    return self;
}
@end
